#include "ObserverUI.h"
#include <QDebug>

#include ".\UI\ModRun\Output\FactoryOutput.h"

ObserverUI::ObserverUI()
{
    QString strOutput = "ObserverUI 构造";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }
}

ObserverUI::~ObserverUI()
{
    QString strOutput = "ObserverUI 析构";
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }
}

void ObserverUI::Update(QString strStatus)
{
    QString strOutput = "ObserverUI Update Status ：" + strStatus;
    qDebug() << strOutput;
    std::shared_ptr<IOutput> pOutPut = FactoryOutput::GetInstance()->CreateRunOutput();
    if (pOutPut)
    {
        std::initializer_list<QString> outList{ strOutput };
        pOutPut->OutPut(outList);
    }
}

QString ObserverUI::GetName()
{
    return "ObserverUI";
}
